import random
import requests

#  伪装浏览器头部


def getHeader():
    header = {

    }
    return header


def getproxies():
    proxy_list = ['118.123.0.244:443']
    proxy = random.choice(proxy_list)
    proxies = {'http': 'http://' + proxy, 'https': 'https://' + proxy}
    return proxies


def get(url, params=None):
    response = requests.get(url=url, params=params,
                            headers=getHeader(), verify=False)
    return response.json() if response.status_code == 200 else None


def post(url, data=None):
    response = requests.post(
        url=url, data=data, headers=getHeader(), verify=False)
    return response.json() if response.status_code == 200 else None
